<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/share/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>驾考训练</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@ include file="/WEB-INF/share/wechat.jsp"%>
</head>
<body>
	<%@ include file="/WEB-INF/share/wechattop.jsp"%>
	<div class="mui-content">
		<div class="mui-control-content mui-active">
			<div class="header">
				<h3>我的序号</h3>
			</div>
			<ul class="mui-table-view">
			<c:if test="${has == '0'}">
				<li class="mui-table-view-cell">
					<div style="justify-content: space-between" class="box">
						<div style="text-align: center;">
							<p>您好，您还未购买完整版系统，付款后面后享受更多功能</p>
							<br>
							<p>
								<button type="button" class="mui-btn mui-btn-primary"
									onclick="buycode('${ctx}/wxpay/payindex')">马上开通</button>
							</p>
						</div>
					</div>
				</li>
				</c:if>
			<c:if test="${has == '1'}">
				<li class="mui-table-view-cell">
					<div style="justify-content: space-between" class="box">
						<div>序号:${_xh.xh}</div>
						<div>
							<p class='mui-ellipsis'>
								<button type="button" class="mui-btn mui-btn-primary"
									onclick="examcode('10365','2')">马上练习</button>
							</p>
						</div>
					</div>
				</li>
				<li class="mui-table-view-cell"><a class="choose">
						<div class="mui-media-body">
							<div style="font-size: 0.32rem; margin: 0.2rem auto;"
								class="box box-align-left">
								<div style="text-align: left;" class="item">到期日期:<fmt:formatDate value="${_xh.lasttime}" pattern="yyyy-MM-dd HH:mm:ss"/></div>
							</div>
							<%-- <div style="font-size: 0.32rem; margin: 0.2rem auto;"
								class="box box-align-left">
								<div style="text-align: left;" class="item">剩余次数:${_xh.lastcount}</div>
							</div> --%>
						</div>
				</a></li>
				</c:if>
			</ul>
			<div style="width: 100%; height: 50px"></div>
		</div>
	</div>
	<%@ include file="/WEB-INF/share/wechatscript.jsp"%>
	<script>
		var url = '${url}';
		var dourl="${ctx}/wx/index";
		if(url)dourl = url;
					function examcode(id,codetype){
						if(codetype==1){
							layer.open({
							    content: '序列号只可在电脑端使用'
							    ,skin: 'msg'
							    ,time: 2
							 });
							return;
						}
						$.ajax({
						        type: "POST",
						        url: "${ctx}/wx/xhkaoshi",
						        data: {id:id},
						        dataType: "json",
						        success: function (data) {
						        	if (data.type === 1) {
						        		layer.open({
										    content: data.message
										    ,skin: 'msg'
										    ,time: 2
										 });
						                setTimeout(function () {
						                    location.href = dourl;
						                }, 1000);
						            }
						        	layer.open({
									    content: data.message
									    ,skin: 'msg'
									    ,time: 2
									 });
						        }
						    });
						
					}
					function buycode(url){
						location.href = url;
					}
		</script>
</body>
</html>
